﻿<html>
<head>
</head>
<body>

    <script>
        var counter = 1;
        function buttonClicked(e) {
            invokeCSharpAction(counter++);
        }

        function nativeDemand(data) {
            var el = document.getElementById('webtext');
            el.innerHTML = data;
        }
        function buttonClicked1(e) {
            var res = "native://";
            el.innerHTML = res;
        }

        function openDialog() {
            var promise = window.dialogs.open_file_dialog();
            promise.then((fileData) => {
                let text = atob(fileData);
                console.log(text);
            });
        }

        function saveFile() {
            window.dialogs.save_file("test file", "test.txt");
        }

    </script>

    <div style='display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%'>
        <h2 style='font-family: script'><i>Fancy Web Title</i></h2>
        <button style='height:48px; margin-left: 15px; margin-right: 15px; width: 128px; background: lightblue' id='hereBtn' onclick='openDialog()'>openDialog</button>
        <button style='height:48px; margin-left: 15px; margin-right: 15px; width: 128px; background: lightblue' id='hereBtn' onclick='saveFile()'>saveFile</button>
    </div>
</body>
</html>